'''
Created on 08/06/2012

@author: rcasal
'''

if 0:
    None
    import gluon
    global db; db = gluon.sql.DAL()

class ConsultaRepository(object):
    '''
    classdocs
    '''
    @staticmethod    
    def findAll():
        return db(db.Consultas.id > 0).select()
    
    @staticmethod
    def finById(id): #@ReservedAssignment
        return db(db.Consultas.id == id).select().last()
    
    @staticmethod
    def save(form_vars): #@ReservedAssignment
        return db.Consultas.insert(**db.Consultas._filter_fields(form_vars))
        
     
